package io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class OosDemo {
    public static void main(String[] args) throws IOException {
        Student s1 = new Student(18,"小明","男",new String[]{"大一","405寝室"});
        FileOutputStream fos = new FileOutputStream("s1.obj");
        ObjectOutputStream oos =new ObjectOutputStream(fos);
        oos.writeObject(s1);
        System.out.println("序列化对象");
        oos.close();
        fos.close();

    }
}
